import { lineTo, moveTo } from "@/utils/common"
export default class Line {
  constructor(fromX, fromY, toX, toY) {
    this.fromX = fromX
    this.fromY = fromY
    this.toX = toX
    this.toY = toY
    this.color = 'black'
    this.lineWidth = 2 * window.devicePixelRatio
  }


  draw(ctx) {
    ctx.beginPath()
    ctx.lineWidth = this.lineWidth
    ctx.strokeStyle = this.color
    moveTo(ctx, this.fromX, this.fromY)
    lineTo(ctx, this.toX, this.toY)
    ctx.stroke()
  }
}